Skip to content

Conversation

@cakedan
Copy link

@cakedan cakedan commented Oct 9, 2025

What does this PR do?

Fixes QwenImageEditPlusPipeline not using the passed in width/height for the VAE.

Currently if you set the width/height to anything other than 1024x1024, for example 512x512, the image will be resized to 1024x1024 before being passed in the VAE then cropped to fit the passed in widthxheight which results in a zoomed in photo.

@JoeGaffney
Copy link

I noticed this issue with 16by 9 ratio. Glad you found what it was

@JoeGaffney
Copy link

JoeGaffney commented Nov 16, 2025

Hey,

I got some pretty good results doing.

def image_edit_call(context: ImageContext):
    # see https://github.com/huggingface/diffusers/pull/12453/files
    import diffusers.pipelines.qwenimage.pipeline_qwenimage_edit_plus as qwen_edit_module

    qwen_edit_module.VAE_IMAGE_SIZE = context.width * context.height

    # gather all possible reference images
    reference_images = []
    if context.color_image:
        reference_images.append(context.color_image)

    for current in context.get_reference_images():
        if current is not None:
            reference_images.append(current)

    prompt_embeds, prompt_embeds_mask = qwen_edit_encode(context.data.prompt, reference_images)
    pipe = get_edit_pipeline("ovedrive/Qwen-Image-Edit-2509-4bit")

    args = {
        "width": context.width,
        "height": context.height,
        "prompt_embeds": prompt_embeds,
        "prompt_embeds_mask": prompt_embeds_mask,
        "negative_prompt": "",
        "image": reference_images,
        "generator": context.generator,
        "num_inference_steps": 8,
        "true_cfg_scale": 1.0,
    }

    processed_image = pipe.__call__(**args).images[0]
    context.cleanup()

    return processed_image

Before
qwen-image_image_to_image - Copy

After
qwen-image_image_to_image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants